package JAVASE515;

import java.util.Scanner;

public class JAVAplane {
    public static void main(String[] argc){
        int month,seat;
        double ticket;
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入机票原价、月份、头等舱或经济舱（0/1）");
        ticket= sc.nextDouble();
        month= sc.nextInt();
        seat= sc.nextInt();
        double money;
        if(month>=5&&month<=10){
            money=getprice(ticket, seat,0.9,0.85);
        }else{
            money=getprice(ticket, seat,0.7,0.65);
        }
        System.out.println(money);
    }
    public static double getprice(double ticket,int seat,double v0,double v1){
        if (seat==0){
            ticket=ticket*v0;
        }else if(seat==1){
            ticket=ticket*v1;
        }
        return ticket;
    }
}
